/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Simulation.Messages;

/**
 *
 * @author aking2
 */
public class DesignateHostConfigMessage extends Message {
    
    public DesignateHostConfigMessage(
      byte simulatorIdIn,
      byte simulatorTypeIn) {
        messageID   = Simulation.Messages.Message.MessageIdEnum.IOS_DESIGNATE_HOST_CONFIG;
        messageData = new byte[MessageSize(messageID)];
        SetSimulatorId( simulatorIdIn );
        SetSimulatorType(simulatorTypeIn);
    }  
    
    public DesignateHostConfigMessage() {
        messageID   = Simulation.Messages.Message.MessageIdEnum.IOS_DESIGNATE_HOST_CONFIG;
        messageData = new byte[MessageSize(messageID)];
    }      
    
    public DesignateHostConfigMessage(Message msg) {
        this.messageID = msg.messageID;
        this.messageData = msg.messageData;
    }    
    
    public final void SetSimulatorId(byte s) {
        messageData[0] = s;     
    }      
    
    public final void SetSimulatorType(byte s) {
        messageData[1] = s;     
    }          
    
    public final byte GetSimulatorId() {
        return messageData[0];
    }      
    
    public final byte GetSimulatorType() {
        return messageData[1];
    }     
 
    public static final byte SIM_TYPE_UNKNOWN   = 0;
    public static final byte SIM_TYPE_CR2_GVS   = 1;
    public static final byte SIM_TYPE_CR2_VSS   = 2;
    public static final byte SIM_TYPE_WR_GVS    = 3;
    public static final byte SIM_TYPE_WR_VSS    = 4;
    public static final byte SIM_TYPE_TITAN_GVS = 5;
    
    public static String StringForConfig( byte config) {
        String result;
        switch (config) {

            case SIM_TYPE_CR2_GVS:
                result = "CR2 GVS";
                break;
            case SIM_TYPE_CR2_VSS:
                result = "CR2 VSS";
                break;
            case SIM_TYPE_WR_GVS:
                result = "WR GVS";
                break;   
            case SIM_TYPE_WR_VSS:
                result = "WR VSS";
                break;   
            case SIM_TYPE_TITAN_GVS:
                result = "Titan GVS";
                break;                   
            default:
                result = "Unknown";
                break;                
        }
        return result;
    }    
    
}
